# Version 0.0.1
FROM docker.rainbond.cc/openjdk:20-ea-20-jdk-buster
MAINTAINER chad <li17206@163.com>

ENV APP_HOME=/opt/app

# copy arthas
COPY --from=docker.rainbond.cc/hengyunabc/arthas:latest /opt/arthas /opt/arthas
#ADD ./arthas /opt/arthas

# 替换阿里源
ADD sources.list /etc/apt/sources.list
# 安装必要软件，update、cron、第天3点执行任务、创建/opt/app目录
RUN \
  apt-get -y update && \
  apt-get -y install cron && \
  echo "0 3 * * * root $APP_HOME/sh/log-cron.sh >> /var/log/cron.log 2>&1" >> /etc/crontab && \
  mkdir -p $APP_HOME

# 拷贝启动脚本
ADD entry.sh /opt/entry.sh

# 设置时区为东八区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

VOLUME $APP_HOME
EXPOSE 9090
WORKDIR $APP_HOME

ENTRYPOINT ["/opt/entry.sh"]
CMD ["-Xms2048", "-Xmx2048"]
